{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Push Or SMS To Handset",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "COMMS" ],
      "description" : "CMP categorisation of the job associated with this file."
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "PUSH", "SMS" ],
      "description" : "Sub-categorisation of the job"
    },
    "version" : {
      "type" : "number",
      "minimum" : 2.0,
      "maximum" : 2.0,
      "description" : "The current version of the file."
    },
    "transmitDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "The data and time that this JSON was transmitted to the external system."
    },
    "isoCurrencyCode" : {
      "type" : "string",
      "pattern" : "^[a-zA-Z0-9]+$",
      "minLength" : 3,
      "maxLength" : 3,
      "description" : "This indicates the currency that any fields that contain monetary amounts are in."
    },
    "comm" : {
      "$ref" : "#/definitions/CommsPushOrSMSToHandset"
    }
  },
  "required" : [ "interfaceCategory", "interfaceType", "version", "transmitDateTime", "isoCurrencyCode" ],
  "definitions" : {
    "CommsPushOrSMSToHandset" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "commsRequestId" : {
          "type" : "integer",
          "minimum" : 1,
          "description" : "This is the unique id in CMP for this Comm Request."
        },
        "targetServiceId" : {
          "type" : "string",
          "maxLength" : 26,
          "description" : "May contain the mobile number but depends on the CMP implementation. This will be in E164 format"
        },
        "from" : {
          "type" : "string",
          "description" : "Null"
        },
        "message" : {
          "type" : "string",
          "description" : "500 characters of a text message that contains the message"
        },
        "push" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/CommsWebPush"
          },
          "description" : "List of web push endpoints to which this message must be sent."
        }
      },
      "required" : [ "commsRequestId", "message" ]
    },
    "CommsWebPush" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "endpoint" : {
          "type" : "string",
          "description" : "The URL that allows an application server to request delivery of a push message to a web application."
        },
        "key" : {
          "type" : "string",
          "description" : "The P-256 ECDH Diffie-Hellman public key for the Push API."
        },
        "auth" : {
          "type" : "string",
          "description" : "The authentication secret for the Push API."
        }
      }
    }
  }
}